package com.cm.caseManagement.service.impl;


import com.cm.caseManagement.dao.CmDashboardStatsSnapsMapper;
import com.cm.caseManagement.pojo.entity.CmDashboardStatsSnaps;
import com.cm.caseManagement.service.ICmDashboardStatsSnapsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cm.caseManagement.utils.DateUtils;

import java.util.List;

/**
 * 统计看板快照Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmDashboardStatsSnapsServiceImpl implements ICmDashboardStatsSnapsService
{
    @Autowired
    private CmDashboardStatsSnapsMapper cmDashboardStatsSnapsMapper;

    /**
     * 查询统计看板快照
     *
     * @param id 统计看板快照主键
     * @return 统计看板快照
     */
    @Override
    public CmDashboardStatsSnaps selectCmDashboardStatsSnapsById(Long id)
    {
        return cmDashboardStatsSnapsMapper.selectCmDashboardStatsSnapsById(id);
    }

    /**
     * 查询统计看板快照列表
     *
     * @param cmDashboardStatsSnaps 统计看板快照
     * @return 统计看板快照
     */
    @Override
    public List<CmDashboardStatsSnaps> selectCmDashboardStatsSnapsList(CmDashboardStatsSnaps cmDashboardStatsSnaps)
    {
        return cmDashboardStatsSnapsMapper.selectCmDashboardStatsSnapsList(cmDashboardStatsSnaps);
    }

    /**
     * 新增统计看板快照
     *
     * @param cmDashboardStatsSnaps 统计看板快照
     * @return 结果
     */
    @Override
    public int insertCmDashboardStatsSnaps(CmDashboardStatsSnaps cmDashboardStatsSnaps)
    {
        cmDashboardStatsSnaps.setCreateTime(DateUtils.getNowDate());
        return cmDashboardStatsSnapsMapper.insertCmDashboardStatsSnaps(cmDashboardStatsSnaps);
    }

    /**
     * 修改统计看板快照
     *
     * @param cmDashboardStatsSnaps 统计看板快照
     * @return 结果
     */
    @Override
    public int updateCmDashboardStatsSnaps(CmDashboardStatsSnaps cmDashboardStatsSnaps)
    {
        cmDashboardStatsSnaps.setUpdateTime(DateUtils.getNowDate());
        return cmDashboardStatsSnapsMapper.updateCmDashboardStatsSnaps(cmDashboardStatsSnaps);
    }

    /**
     * 批量删除统计看板快照
     *
     * @param ids 需要删除的统计看板快照主键
     * @return 结果
     */
    @Override
    public int deleteCmDashboardStatsSnapsByIds(Long[] ids)
    {
        return cmDashboardStatsSnapsMapper.deleteCmDashboardStatsSnapsByIds(ids);
    }

    /**
     * 删除统计看板快照信息
     *
     * @param id 统计看板快照主键
     * @return 结果
     */
    @Override
    public int deleteCmDashboardStatsSnapsById(Long id)
    {
        return cmDashboardStatsSnapsMapper.deleteCmDashboardStatsSnapsById(id);
    }
}
